package com.heima.admin.controller;

import com.heima.admin.service.AdminUserService;
import com.heima.model.admin.datos.AdminUserDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱安东
 * @version 1.0
 * @project leadnews-project
 * @date 2024/1/24 21:50:41
 */
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private AdminUserService adminUserService;

    /**
     * 登录
     *
     * @param adminUserDto 管理员用户 DTO
     * @return {@link ResponseResult}
     */
    @PostMapping("/in")
    public ResponseResult login(@RequestBody AdminUserDto adminUserDto){
        return adminUserService.login(adminUserDto);
    }
}
